package cn.tp.ksoft.civil_driver.view.simple;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

public class SpaceItemDecoration extends RecyclerView.ItemDecoration{
   
        private int space;  
        private int left;
        public SpaceItemDecoration(int space) {  
            this.space = space;  
        }
        public SpaceItemDecoration(int space, int left) {
            this.space = space;
            this.left = left;
        }
   
        @Override 
        public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
   
            if(parent.getChildPosition(view) != 0)
                outRect.top = space;
                outRect.left = left;
        }
    }